{#if loading}
Loading...
{:else if error}
{error}
{:else if img}
{img.filename}
{#if img.thumbnail_path}
{:else}
NO THUMBNAIL
{/if}
UPLOADED BY
{#if img.avatar_url}
{/if}
{img.uploader_username}
ID
#{img.id}
DIMENSIONS
{img.width} × {img.height}
FILE SIZE
{formatSize(img.file_size)}
TYPE
{img.mime_type}
UPLOADED
{formatDate(img.created_at)}
TAGS
{#if img.tags_detail.length > 0 || (img.innate_tags && img.innate_tags.length > 0)} {#each img.tags_detail as t (t.tag)}
{t.tag}
{t.usage_count}
{/each} {#if img.innate_tags} {#each img.innate_tags as t (t)}
{t}
{/each} {/if} {:else}
none
{/if}
{#if img.is_owner}
EDIT TAGS
{ if (e.key === 'Enter') { if (sugIndex >= 0 && sugIndex < suggestions.length) { e.preventDefault(); selectSuggestion(suggestions[sugIndex]); } } else if (e.key === 'Tab' || e.key === 'ArrowDown') { if (showSuggestions && suggestions.length > 0) { e.preventDefault(); sugIndex = (sugIndex + 1) % suggestions.length; } } else if (e.key === 'ArrowUp') { if (showSuggestions && suggestions.length > 0) { e.preventDefault(); sugIndex = sugIndex <= 0 ? suggestions.length - 1 : sugIndex - 1; } } else if (e.key === 'Escape') { showSuggestions = false; sugIndex = -1; } }} onblur={() => setTimeout(() => { showSuggestions = false; sugIndex = -1; }, 200)} /> {#if showSuggestions}
{#each suggestions as s, i}
selectSuggestion(s)}>{s}
{/each}
{/if}
ADD
REMOVE
{#if tagError}
{tagError}
{/if}
{/if}
DOWNLOAD ORIGINAL
{ try { const r = await toggleGem(img.id); img.gemmed = r.gemmed; img.gem_count = r.gem_count; } catch (err) { console.error('gem toggle failed:', err); } }} aria-label="Toggle gem">
{img.gem_count || 0}
← BACK TO BROWSE
{/if}